<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserNoticesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_notices', function (Blueprint $table) {
            $table->id()->comment('通知消息记录表');
            $table->integer('user_id')->comment('用户id')->index();
            $table->tinyInteger('type')->default(0)->comment('消息通知类型 0:系统消息；1:用户通知');
            $table->string('sender_user_id')->comment('发送人id');
            $table->string('title',100)->comment('通知消息的标题信息');
            $table->text('content')->comment('通知消息的内容');
            $table->integer('is_send')->default(1)->comment('是否发送 0:未发送；1:已发送')->index();
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_notices');
    }
}
